﻿<Window x:Class="Elderos.Dialogs.MsgBox"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        mc:Ignorable="d" 
        xmlns:my="clr-namespace:Elderos.Dialogs"
        Icon="{Binding RelativeSource={RelativeSource AncestorType=my:MsgBox,AncestorLevel=1},Path=Image}"
        WindowStartupLocation="CenterOwner" 
        SizeToContent="WidthAndHeight" 
        WindowStyle="ToolWindow"
        Title="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:MsgBox, AncestorLevel=1}, Path=Title}"
        ResizeMode="NoResize" MaxHeight="800" MaxWidth="600">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="27"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="70"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Image Width="32" Height="32" Margin="10,10,10,10" Grid.Row="0" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" 
                   Source="{Binding RelativeSource={RelativeSource AncestorType=my:MsgBox,AncestorLevel=1},Path=Image}" />
        <Grid Grid.Column="1" Name="TextGrid">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="3*"/>
            </Grid.RowDefinitions>
            <TextBlock Name="CaptionBlock" Margin="10,10,10,10" Foreground="SkyBlue" FontSize="24" Grid.Column="1" VerticalAlignment="Bottom"
                       Text="{Binding RelativeSource={RelativeSource AncestorType=my:MsgBox,AncestorLevel=1},Path=Caption}" TextWrapping="Wrap" />
            <TextBox BorderThickness="0" Name="MessageBlock"
                     Margin="20,0,10,10"
                     Grid.Row="1"
                     Grid.Column="1"
                     Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:MsgBox, AncestorLevel=1}, Path=Text}" 
                     MaxWidth="600" 
                     IsReadOnly="True" 
                     TextWrapping="Wrap" IsTabStop="False" VerticalScrollBarVisibility="Auto" />
        </Grid>
        
        <StackPanel Name="ButtonPanel" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="25,0,20,0">
        </StackPanel>
    </Grid>
</Window>
